/*
 * Copyright (c)e 2024-2024.Powered by 清明雨揽月
 * This software is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN 'AS IS' BASIS, WITHOUT WARRANTIES OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 * NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef DATASTRUCTURES_LOOK_UP
#define DATASTRUCTURES_LOOK_UP

#define ARRAY_LENGTH 10

typedef struct S_TABLE
{
    /* data */
    int* elem; // 动态数组基址
    int length;
} s_table;

class look_up
{
private:
    s_table _s_table{};
    int arr_unordered[ARRAY_LENGTH] = {1, 21, 30, 51, 63, 72, 423, 88, 95, 20};
    int arr_ordered[ARRAY_LENGTH] = {1, 21, 312, 423, 500, 601, 712, 833, 918, 1000};

public:
    void operate();
    int search_seq(int key) const;
    int search_bin(int key) const;
};

#endif // DATASTRUCTURES_LOOK_UP
